package top.xzxsrq.web.download.entity;

import lombok.Data;

import java.util.Objects;

@Data
public class CheckFile extends PageInfo {
    // 获取到的视频时长
    private Float httpVideoTimeLength;
    // 系统编码路径
    private String systemPath;

    /**
     * 保存文件mp4文件的路径
     *
     * @return
     */
    public String getLocalPath() {
        return systemPath + getDownloadName() + ".mp4";
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        CheckFile checkFile = (CheckFile) o;
        return Objects.equals(systemPath, checkFile.systemPath) || Objects.equals(downloadUrl, checkFile.downloadUrl);
    }

    @Override
    public int hashCode() {
        return Objects.hash(systemPath, downloadUrl);
    }
}
